<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
    <!-- 直接在行内改变数据 不推荐 逻辑和视图 没有分离 -->
    <!-- <button v-on:click="isShow = !isShow">按钮</button>
    {{ isShow?'你是美女':'你是个好姑娘' }} -->

    <!-- 事件触发时 可以 与 实例的方法进行 -->
    <!-- <button v-on:click="fn">按钮</button> -->
    <button @click="fn">按钮</button>
    {{ isShow?'你是美女':'你是个好姑娘' }}

    <button v-on:click="fn(1111)">按钮</button>
    {{ isShow?'你是美女':'你是个好姑娘' }}
    
  </div>
  <script src="./vue.js"></script>
  <script>
    const vm = new Vue({
      el: '#app',
      data: {
        isShow: true
      },
      methods: {
        fn(a){
          console.log(a);
          this.isShow = !this.isShow;
        }
      }
    })
  </script>
</body>
</html>